<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="initial-scale=1, maximum-scale=1, user-scalable=no, width=device-width">
<title>我的认证</title>
<link href="/dist/css/all_min.css" tppabs="http://www.115yz.com/xjkc/dist/css/all_min.css" rel="stylesheet">
</head>
<body>
<!--页头 start-->
<div id="header" class="kc-fixed kc-boxBody kc-commonHeight kc-commonbg">
    <div class="kc-rel">   
        <div class="float-left kc-cannel kc-pos">
             <div class="icon-bar" onclick="url()"></div>
        </div>
        <a class="float-left kc-title textCenter">我的认证</a>
         <!-- <img src="/dist/img/msg.png" class="kc-msg"> -->
    </div>
</div>
<!--页头 end-->
<!--主体 start-->
<div id="bodyer" class="kc-padbody kc-boxBody authen-body">
    <?php foreach($data as $val){?>
  <div class="authen">
      <div class="" id='<?php echo $val["Codes"] ?>' data-id="<?php echo  $authen[$val['Codes']] ==0?'0':'1';?>">
        <div class="heads"><img src="<?php echo $val['ImgUrl'] ?>"><span><?php echo $val['Name']  ?></span></div>
        <div class="last">
          <span>
       		<?php if($authen[$val['Codes']] ==0){        ?>
       			 <span style="color:red">未认证</span>
       		<?php }elseif($authen[$val['Codes']] ==1){   ?>
				<span>已认证</span>
			<?php  }else{                                 ?>
				<span style="color: red">认证中</span>
       <?php } ?>
        </span> <img src="/dist/img/arrow.png"></div>
      </div>
  </div> 
  <?php  } ?> 
<!--   <div class="authen">
      <div class="" id='Id' data-id="<?php echo  $authen['isID'] ==0?'0':'1';?>">
        <div class="heads"><img src="/dist/img/id.png"><span>身份认证</span></div>
        <div class="last"><span><?php echo  $authen['isID'] ==0?'<span style="color:Red">未认证</span>':'<span>已认证</span>';?></span> <img src="/dist/img/arrow.png"></div>
      </div>
  </div>  
    <div class="authen" id="social" data-id="<?php echo  $authen['isSocial'] ==0?'0':'1';?>">
      <div>
        <div class="heads"><img src="/dist/img/social.png"><span>社交认证</span></div>
        <div class="last"><span><?php echo  $authen['isSocial'] ==0?'<span style="color:Red">未认证</span>':'已认证';?></span> <img src="/dist/img/arrow.png"></div>
      </div>
  </div>
    <div class="authen" id="Mobile" data-id="<?php echo  $authen['isMobile'] ==0?'0':'1';?>">
      <div>
        <div class="heads"><img src="/dist/img/mobile.png" id="Mobile"><span>手机认证</span></div>
        <div class="last"><span><?php echo  $authen['isMobile'] ==0?'<span style="color:Red">未认证</span>':'已认证';?></span> <img src="/dist/img/arrow.png"></div>
      </div>
  </div>
    <div class="authen" id="bank" data-id="<?php echo  $authen['isBank'] ==0?'0':'1';?>">
      <div>
        <div class="heads"><img src="/dist/img/bank.png"><span>收款银行</span></div>
        <div class="last"><span><?php echo  $authen['isBank'] ==0?'<span style="color:Red">未认证</span>':'已认证';?></span> <img src="/dist/img/arrow.png"></div>
      </div>
  </div> -->
</div>
<script src="/resourse/jquery/jquery-1.11.3.min.js" tppabs="http://www.115yz.com/xjkc/resourse/jquery/jquery-1.11.3.min.js"></script>
<script src="/dist/js/all_min.js" tppabs="http://www.115yz.com/xjkc/dist/js/all_min.js"></script>
<script src="/dist/js/md5.js" tppabs="http://www.115yz.com/xjkc/dist/js/all_min.js"></script>
<script src="/dist/js/aes.js" tppabs="http://www.115yz.com/xjkc/dist/js/all_min.js"></script>
<script src="/dist/js/july.js" tppabs="http://www.115yz.com/xjkc/dist/js/all_min.js"></script>

<script type="text/javascript">


  //基本项比填
  var ID =  $('#isID').attr('data-id');

  //绑卡
  $('#isBank').click(function(){
    if( $(this).attr('data-id')==1){
      openTip('您已经完成该项认证')
      return false;
    }
    if(ID =='0'){
      openTip('您必须先完成身份认证')
      return false;
    }
        window.location.href ='/index.php/index/bank'
    }
  )
//手机认证
  $('#isMobile').click(function(){
    if( $(this).attr('data-id')==1){
      openTip('您已经完成该项认证')
      return false;
    }
    if(ID =='0'){
      openTip('您必须先完成身份认证')
      return false;
    }
    let url ='http://xjdd.51xingdai.com/api.php/index/mx_backUrl';
    url = encodeURI(url);
    let userId = "<?php echo $user['ID']; ?>";
    let phone ="<?php echo $user['Mobile']  ?>";
    let idcard="<?php echo $user['IDCard']  ?>";
    let name="<?php echo $user['TrueName']  ?>"; 
    window.location.href = 'https://api.51datakey.com/h5/importV3/index.html#/carrier?apiKey=8ae4715e3cbf41079b192ef15d7c72f4&userId='+userId+'&backUrl='+url+'&themeColor=#1C1C1E&phone='+phone+'&idcard='+idcard+'&name='+name;
  })

  $('#isSocial').click(function(){
    if( $(this).attr('data-id')==1){
      openTip('您已经完成该项认证')
      return false;
    }
    if(ID =='0'){
      openTip('您必须先完成身份认证')
      return false;
    }
   url('/index.php/index/social')
  })

  $('#isID').click(function(){
   if( $(this).attr('data-id')==1){
      openTip('您已经完成该项认证')
      return false;
    }
     let partner_order_id =<?php echo $session; ?> ;//商户唯一订单号
     let date = new Date();
    Y = date.getFullYear();
    M = (date.getMonth()+1 < 10 ? '0'+(date.getMonth()+1) : date.getMonth()+1) ;
    D = date.getDate();
    h = date.getHours();
    m = date.getMinutes();
    s = date.getSeconds(); 
    let time = Y+M+D+h+m+s;
    let sign = getMD5Sign('f7b2fac9-0fb9-43f6-9406-c7c3bd6dfee5',partner_order_id,time,'9291591d-e051-4c46-800f-8e0753ddaffb');
    var params="pub_key=f7b2fac9-0fb9-43f6-9406-c7c3bd6dfee5&partner_order_id="+partner_order_id+"&sign_time="+time+"&sign="+sign+"&return_url=http://xjdd.51xingdai.com/index.php/index/authen&callback_url=http://xjdd.51xingdai.com/index.php/index/authen";
    var url="https://static.udcredit.com/id/v43/index.html?apiparams=" + getAESSign(params);
    window.location.href = url;
  })
  function getMD5Sign (pub_key, partner_order_id, sign_time, security_key) {
        var signStr = "pub_key=" + pub_key + "|partner_order_id=" + partner_order_id + "|sign_time=" + sign_time + "|security_key=" + security_key;
        return hex_md5(signStr);
  }
  function getAESSign (_params) {
        return CryptoJS.AES.encrypt(_params, CryptoJS.enc.Utf8.parse("4c43a8be85b64563a32244db9caf8454"), {
            mode: CryptoJS.mode.ECB,
            padding: CryptoJS.pad.Pkcs7
        }).toString();
  }
   
</script>
</body>
</html>